﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace DebugWriterTextBox
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void testButton_Click(object sender, EventArgs e)
        {
            Debug.WriteLine("Writing this to filename from this.debugWriterTextBox1.LogFileName");
            Debug.WriteLine("Changing otput file name. This cause debugWriterTextBox1 to close old file and open new");
            
            this.debugWriterTextBox1.LogFileName = "new file.txt";
            
            Debug.WriteLine("And now all debug info writes into new file!");
        }
    }
}
